package com.feidee.data.report.model;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.util.Map;

public class ReportParam {
    @NotEmpty
    @NotNull
    private String kpi;
    @NotEmpty
    @NotNull
    private String apt;
    @NotEmpty
    @NotNull
    private String key;

    private String hql;
    private String eng = "hive"; // 执行引擎
    private String refresh_tables;
    private String index;

    private String process_class;

    private String mysql;
    private String mysqlTable;
    private String opr; // 选择是select 还是create等
    private String backup; // 数据库是否需要备份

    private String table_type = "horizontal";

    private String mysql_table;

    private String mysql_keys;

    private String isCustom; // 是否为自定义报表
    private String applyId; // 自定义报表任务ID
    private String history; // 是否执行历史sql

    private String admin; //是否为管理员,管理员不停止以前运行的相同报表

    private String enable;  //执行的is_enable字段的类型，默认为1

    private Map<String, ReportConfiguration> dataMap; //同时执行一组sql[手动提供sql]

    private String forceExec; //强制执行报表，忽略依赖关系，忽略历史SQL延迟执行

    private String requestId;   // 调度系统调起返回结果标识ID

    private String isSchedule;  // 是否属于数据源调度

    private String dataResources;  // 调度系统调起返回结果标识ID

    private int curSparkConNum;    // spark本次连接环境

    private String period; //执行周期

    public String getMysql() {
        return mysql;
    }

    public void setMysql(String mysql) {
        this.mysql = mysql;
    }

    public String getMysqlTable() {
        return mysqlTable;
    }

    public void setMysqlTable(String mysqlTable) {
        this.mysqlTable = mysqlTable;
    }

    public String getEng() {
        return eng;
    }

    public void setEng(String eng) {
        this.eng = eng;
    }

    public String getRefresh_tables() {
        return refresh_tables;
    }

    public void setRefresh_tables(String refresh_tables) {
        this.refresh_tables = refresh_tables;
    }

    public String getKpi() {
        return kpi;
    }

    public void setKpi(String kpi) {
        this.kpi = kpi;
    }

    public String getApt() {
        return apt;
    }

    public void setApt(String apt) {
        this.apt = apt;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getHql() {
        return hql;
    }

    public void setHql(String hql) {
        this.hql = hql;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getBackup() {
        return backup;
    }

    public void setBackup(String backup) {
        this.backup = backup;
    }

    public String getOpr() {
        return opr;
    }

    public void setOpr(String opr) {
        this.opr = opr;
    }

    public String getProcess_class() {
        return process_class;
    }

    public void setProcess_class(String process_class) {
        this.process_class = process_class;
    }

    public String getTable_type() {
        return table_type;
    }

    public void setTable_type(String table_type) {
        this.table_type = table_type;
    }

    public String getMysql_table() {
        return mysql_table;
    }

    public void setMysql_table(String mysql_table) {
        this.mysql_table = mysql_table;
    }

    public String getMysql_keys() {
        return mysql_keys;
    }

    public void setMysql_keys(String mysql_keys) {
        this.mysql_keys = mysql_keys;
    }

    public String getIsCustom() {
        return isCustom;
    }

    public void setIsCustom(String isCustom) {
        this.isCustom = isCustom;
    }

    public String getApplyId() {
        return applyId;
    }

    public void setApplyId(String applyId) {
        this.applyId = applyId;
    }

    public void setHistory(String history) {
        this.history = history;
    }

    public String getHistory() {
        return history == null ? "0" : history;
    }

    public String getAdmin() {
        return admin == null ? "0" : "1";
    }

    public void setAdmin(String admin) {
        this.admin = admin;
    }

    public Map<String, ReportConfiguration> getDataMap() {
        return dataMap;
    }

    public void setDataMap(Map<String, ReportConfiguration> dataMap) {
        this.dataMap = dataMap;
    }

    public String getForceExec() {
        return forceExec == null ? "0" : forceExec;
    }

    public void setForceExec(String forceExec) {
        this.forceExec = forceExec;
    }

    public String getEnable() {
        return enable;
    }

    public void setEnable(String enable) {
        this.enable = enable;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getDataResources() {
        return dataResources;
    }

    public void setDataResources(String dataResources) {
        this.dataResources = dataResources;
    }

    public String getIsSchedule() {
        return isSchedule;
    }

    public void setIsSchedule(String isSchedule) {
        this.isSchedule = isSchedule;
    }

    public int getCurSparkConNum() {
        return curSparkConNum;
    }

    public void setCurSparkConNum(int curSparkConNum) {
        this.curSparkConNum = curSparkConNum;
    }

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }
}
